home *** CD-ROM | disk | FTP | other *** search
/ Exame Informatica 139 / Exame Informatica 139.iso / Revista / Flash / Uniform Server / diskw / home / admin / www / phpMyBackupPro / javascripts.js < prev    next >
Encoding:
Text File  |  2005-07-14  |  3.9 KB  |  85 lines

  1. <script type="text/javascript">
  2. /*
  3.  +--------------------------------------------------------------------------+
  4.  | phpMyBackupPro                                                           |
  5.  +--------------------------------------------------------------------------+
  6.  | Copyright (c) 2004-2005 by Dirk Randhahn                                 |
  7.  | http://www.phpMyBackupPro.net                                            |
  8.  | Version information can be found in definitions.php.                     |
  9.  |                                                                          |
  10.  | This program is free software; you can redistribute it and/or            |
  11.  | modify it under the terms of the GNU General Public License              |
  12.  | as published by the Free Software Foundation; either version 2           |
  13.  | of the License, or (at your option) any later version.                   |
  14.  |                                                                          |
  15.  | This program is distributed in the hope that it will be useful,          |
  16.  | but WITHOUT ANY WARRANTY; without even the implied warranty of           |
  17.  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            |
  18.  | GNU General Public License for more details.                             |
  19.  |                                                                          |
  20.  | You should have received a copy of the GNU General Public License        |
  21.  | along with this program; if not, write to the Free Software              |
  22.  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.|
  23.  +--------------------------------------------------------------------------+
  24. */
  25.  
  26. // opens a pop up window showing the file 'path', having 'title' as window title
  27. function popUp(path,title) {
  28.     var popwin;
  29.     if (title!="view") {
  30.         // small window
  31.         leftval=(screen.width)?(screen.width-400)/2:100;
  32.         topval=(screen.height)?(screen.height-500)/2:100;
  33.         popwin=window.open(path, title, "width=400,height=500,top=" + topval + ",left=" + leftval + ",toolbar=0,scrollbars=1,directories=no,location=0,statusbar=0,menubar=0,resizable=0");
  34.     } else {
  35.         // big window
  36.         leftval=(screen.width)?(screen.width-750)/2:100;
  37.         topval=(screen.height)?(screen.height-750)/2:100;
  38.         popwin=window.open(path, title, "width=750,height=750,top=" + topval + ",left=" + leftval + ",toolbar=0,scrollbars=1,directories=no,location=0,statusbar=0,menubar=0,resizable=1");
  39.     }
  40.     popwin.focus();
  41. }
  42.  
  43. // selects all entries in the selectbox 'select_name' in the form 'form_name'
  44. function setSelect(form_name, select_name) {
  45.     var select_field=document.forms[form_name].elements[select_name];
  46.     for (var i=0; i < select_field.length; i++) select_field.options[i].selected=true;
  47.     return true;
  48. }
  49.  
  50. // opens a dialog box with 'title' as title
  51. // when user clicks ok, he will be forwarded to file 'path'
  52. function confirmClick(title,path) {
  53.     var input=confirm(title);
  54.     if (input) window.location.href=path;
  55. }
  56.  
  57. // changes the color of table row 'tr'
  58. function changeColor(row, new_color) {
  59.     var cells=null;
  60.     var i=null;
  61.  
  62.     // go sure that row is available
  63.     if (typeof(row.style)=='undefined') return false;
  64.  
  65.     // trie to get all fields of current row
  66.     if (typeof(document.getElementsByTagName)!='undefined') {
  67.         cells=row.getElementsByTagName('td');
  68.     } else if (typeof(row.cells)!='undefined') {
  69.         cells=row.cells;
  70.     } else {
  71.         return false;
  72.     }
  73.  
  74.     // change border color
  75.     if (typeof(cells[0].style.setAttribute)!='undefined') {
  76.     for (i=0; i<cells.length; i++) cells[i].style.setAttribute('borderColor',new_color,false);
  77.     } else  if (typeof(cells[0].style.borderColor)!='undefined') {
  78.         for (i=0; i<cells.length; i++) cells[i].style.borderColor=new_color;
  79.     } else {
  80.         return false;
  81.     }
  82.     return true;
  83. </script>
  84.